﻿using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;

namespace Xray.Common
{
    [DataContract(IsReference = true)]
    public class Model
    {
        public Model()
        {
            Components = new List<Component>();
        }

        [DataMember]
        public bool ShowNamespaces { get; set; }

        [DataMember]
        public IList<Component> Components { get; set; }

        public Component FindComponentByFullName(string fullName)
        {
            return Components.Where(x => x.FullName() == fullName).FirstOrDefault();
        }
    }
}